/// title : "re：从零开始的异世界生活【无修正】"
/// url : "http://www.bimiacg4.net/bangumi/bi/242/"
/// cover : "https://lz.sinaimg.cn/large/006MDjU7ly1g7q2rtx01uj307409wt9d.jpg"
/// status : "全25话"
library;

import 'package:vega/http/base_model.dart';

class SearchListModel extends BaseModel<List<SearchListItem>> {
  SearchListModel.fromJson(json): super.fromJson(json) {
    var ls = json['data'] as List<dynamic>;
    data = ls.map((e) => SearchListItem.fromJson(e)).toList();
  }
}

class SearchListItem {
  SearchListItem({
    String? title,
    String? url,
    String? cover,
    String? status,
  }) {
    _title = title;
    _url = url;
    _cover = cover;
    _status = status;
  }

  SearchListItem.fromJson(dynamic json) {
    _title = json['title'];
    _url = json['url'];
    _cover = json['cover'];
    _status = json['status'];
  }
  String? _title;
  String? _url;
  String? _cover;
  String? _status;
  SearchListItem copyWith({
    String? title,
    String? url,
    String? cover,
    String? status,
  }) =>
      SearchListItem(
        title: title ?? _title,
        url: url ?? _url,
        cover: cover ?? _cover,
        status: status ?? _status,
      );
  String? get title => _title;
  String? get url => _url;
  String? get cover => _cover;
  String? get status => _status;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['title'] = _title;
    map['url'] = _url;
    map['cover'] = _cover;
    map['status'] = _status;
    return map;
  }
}
